package mypractice;

public class Leetcode392 {
    public boolean isSubsequence(String s, String t) {
        int i,j;
        int k=-1;
        for(i=0;i<s.length();i++){
            for(j=k+1;j<t.length();j++){
                if(s.charAt(i)==t.charAt(j)){
                    k=j;
                    break;
                }
            }
            if(j==t.length()){
                break;
            }
        }
        if(i==s.length()){
            return true;
        }
        return false;
    }
}
